<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>

<script src="statics/js/jquery-1.12.4.js" charset="utf-8"></script>
<script src="statics/js/usermanage.js"></script>
<script src="statics/layer/layer.js"></script>
<link rel="stylesheet" type="text/css" href="statics/css/pagination.css" />
<link rel="stylesheet" href="statics/css/manage.css" type="text/css"></link>
<script type="text/javascript" src="statics/js/script/jquery.pagination.js" charset="UTF-8"></script>
<script type="text/javascript">
/* $(function(){
	$(".M-box").pagination({
        showData:4,
        totalData: $('.zhong').attr('data-shu'),
        coping:true,
        homePage:'首页',
        endPage:'末页',
        prevContent:'上页',
        nextContent:'下页',
        callback:function(api){
        	console.log("当前页："+api.getCurrent());
    		console.log("总页："+api.getPageCount());
        	$.post('main',{
        		Current:api.getCurrent()
        	},function(data){
        		$('.weichuli').html("");
        		$.each(JSON.parse(data), function(i, item) {
        			var td1=$("<td>").text(getMyDate(item.ujTime));
        			var td2=$("<td>").text(item.ujScore);
        			var td3=$("<td>").text(item.ujReason);
        			var tr=$("<tr>").append(td1).append(td2).append(td3);
        			$('.weichuli').append(tr);
        		});
        		$(".user table>tbody>tr:even").css("background", "#fff");
        		$(".user table>tbody>tr:odd").css("background", "#f9f9f9");
        	})
        }
	});
	  //美化表格
	$("table>tbody>tr:even").css("background", "#fff");
	$("table>tbody>tr:odd").css("background", "#f9f9f9");
	//格式化时间
	 function getMyDate(str){  
	    var oDate = new Date(str),  
	    oYear = oDate.getFullYear(),  
	    oMonth = oDate.getMonth()+1,  
	    oDay = oDate.getDate(),  
	    oHour = oDate.getHours(),  
	    oMin = oDate.getMinutes(),  
	    oSen = oDate.getSeconds(),  
	    oTime = oYear +'-'+ getzf(oMonth) +'-'+ getzf(oDay) +' '+ getzf(oHour) +':'+ getzf(oMin) +':'+getzf(oSen);//最后拼接时间  
	    return oTime;  
	}; 
	//补0操作  
	function getzf(num){  
	    if(parseInt(num) < 10){  
	        num = '0'+num;  
	    }  
	    return num;  
	} 
}); */
</script>
<style type="text/css">
html {
	overflow-x: hidden;
	overflow-y: auto;
}

body {
	margin: 0px;
}

.zhong {
	text-align: center;
	font-weight: 600;
	font-size: 17px;
	height: 30px;
	margin-top: 20px;
}
</style>

</head>
<body>
	<%-- <div class="main-head">
		<jsp:include page="houtai_mainhead.jsp"></jsp:include>
	</div> --%>
	<div
		style="margin-bottom:20px;background-color: #ffffff; border-bottom: 1px solid #d6d6d6; box-shadow: 0 1px 3px #c3c3c3;">
		<img style="padding: 10px 0px 0px 15px" alt="标题"
			src="http://localhost:8080/rentcar/statics/image/yqs/title_b.png">

		<div style="width: 150px; height: 30px; margin: -20px 0px 0px 50px">当前未处理订单</div>
	</div>
	
	<table data-count="${count }" data-pageno="${pageno }"
		data-pre="${preNo }" class="tab">
		<thead>
			<tr>
				<!-- <th><input type="checkbox" onclick="checkAll(this)"></th> -->
				<th>编号</th>
				<th><c:choose>
						<c:when test="${preNo==1 }">
							<br>状态<br>
							<br>
						</c:when>
						<c:otherwise>
							<select name="ostatus">
								<option>状态</option>
								<option>未处理</option>
								<option>租赁中</option>
								<option>已还车</option>
								<option>已完成</option>
								<option>已取消</option>
							</select>
						</c:otherwise>
					</c:choose></th>
				<th>租用车辆</th>
				<th>电话</th>
				<th>联系人</th>
				<th>身份证号码</th>
				<th>服务备注</th>
				<th>金额</th>
				<th>操作</th>
			</tr>
		</thead>

		<tbody class="display">

			<c:forEach items="${Order}" var="em">
				<tr data-status="${em.oStatus}" data-id=${em.oId }>
					<%-- <td><input type="checkbox" onchange="check()" id="${em.oId}"></td> --%>
					<td>${em.oNo}</td>
					<td><c:if test="${em.oStatus=='未处理'}">
							<font style="color: #f8a326;">${em.oStatus}</font>
						</c:if> <c:if test="${em.oStatus!='未处理'}">
							<font style="color: #49bf67;">${em.oStatus}</font>
						</c:if></td>
					<td>${em.cName}</td>
					<td>${em.uaTel}</td>
					<td>${em.uaName}</td>
					<td>${em.uaIdentity}</td>
					<td><div class="serve" data-text="${em.oContent}">${em.oContent}</div></td>
					<td style="color: #AA0000"><fmt:formatNumber type="number" maxFractionDigits="1" value="${em.oMoney}" /></td>
					<td>
						<div class="caozuo">
							<a class="blue" onclick="order_info(this)">更多详情</a>
							<div id="orderInfo"
								style="padding: 10px; display: none; text-align: left;">
								<p>
									<span>取车时间</span>:${em.takeTime}
								</p>
								<p>
									<span>取车地点</span>:${em.takePlace}
								</p>
								<p>
									<span>还车时间</span>:${em.returnTime}
								</p>
								<p>
									<span>还车地点</span>:${em.returnPlace}
								</p>
							</div>
							<a class="blue" onclick="order_record(this)">记录</a>
							<c:if test="${em.oStatus=='已还车'}">
								<a class="green" onclick="returnMoney(this)" data-id=${em.oId }
									data-uid=${em.uId }>退还押金</a>
								<div id="returnMoney">
									<div>
										<input type="checkbox">租期内是否产生违章
									</div>
									<div class="content">
										租期内发生的违章罚款实际金额：<input type="text" name="fakuan" value="0"
											disabled="disabled"
											onkeyup="this.value=this.value.replace(/\D/g,'')"
											onafterpaste="this.value=this.value.replace(/\D/g,'')"><br>
										租期内发生的违章扣分处理费用：<input type="text" name="koufen" value="0"
											disabled="disabled"
											onkeyup="this.value=this.value.replace(/\D/g,'')"
											onafterpaste="this.value=this.value.replace(/\D/g,'')"><br>
										租期内发生违章罚款代办手续费：<input type="text" name="shouxu" value="0"
											disabled="disabled"
											onkeyup="this.value=this.value.replace(/\D/g,'')"
											onafterpaste="this.value=this.value.replace(/\D/g,'')"><br>
									</div>
									<button onclick="confirmReturnMoney(this)" data-id=${em.oId } data-uid=${em.uId }>确认</button>
								</div>
							</c:if>
							<c:if test="${em.oStatus=='未处理'}">
								<a class="green" onclick="giveCar(this)" data-id=${em.oId }>派车</a>
								<div id="giveCar"
									style="padding: 10px; display: none; text-align: center;">
									<div style="padding: 10px; text-align: left;">
										<p>
											当前派车订单：<span>${em.oNo }</span>
										</p>
										<p>
											取车时间：<font>${em.takeTime}</font>
										</p>
										<p>
											取车地点：<font>${em.takePlace}</font>
										</p>
										<p>
											分配车型：<font>${em.cName}</font>
										</p>
									</div>
									<button data-id=${em.oId } onclick="confirmgive(this)">确认派车</button>
								</div>
							</c:if>
							<c:if test="${em.oStatus=='租赁中'}">
								<a class="green" onclick="confirmReturn(this)"
									data-id=${em.oId } data-uid=${em.uId } data-ename=${em.ename }>还车</a>
							</c:if>
							<%-- <a class="red" onclick="ordermodify(1,2,this)" id=${em.oId }>修改</a> --%>
							<%-- <a  class="blue" onclick=""  id=${em.oId } >分配司机</a> --%>
						</div>
					</td>

				</tr>

			</c:forEach>
		</tbody>
	</table>

	</form>

	<div id="driver">
		分配司机： <select name="driver">
			<c:forEach items="${elist }" var="el">
				<option value="${el.ename }">${el.ename }</option>
			</c:forEach>
		</select>
	</div>

	<div id="orderRecord">
		<table>
			<tr height="50px">
				<th>操作记录</th>
				<th>操作人</th>
				<th>操作时间</th>
			</tr>
			<tbody class="display">

			</tbody>
		</table>
	</div>

	<div class="M-box"></div>
</body>
</html>